<?php
if(!defined("DNREAD")) exit();
global $lang,$setting;
if (defined('SETTING')) {
    return $bs = '';
}
$tm->unmanule['captcha'] = ($setting['captcha'] == 'yes' && defined('REMOTE_ADDRS')) ? 'yes' : 'no';
$tm->unmanule['control'] = ($setting['control'] == 'yes') ? 'yes' : 'no';
    $control = $cid = '';
    if ($setting['control'] == 'yes') {
        if (isset($setting['controls']) && is_array($setting['controls'])) {
            $controlarray = $setting['controls'];
        } else {
        	 $i = 0;
             $ci = $db->query("SELECT * FROM ".$basepref."_control",$setting['cachetime']);
             while ($cm = $db->fetchrow($ci,$setting['cache'])) {
                 $controlarray[$i] = array('cid'=>$cm['cid'],'issue'=>$cm['issue']);
                 $i++;
             }
        }
        $r = @rand(0,sizeof($controlarray)-1);
        $control = @$controlarray[$r]['issue'];
        $cid = @$controlarray[$r]['cid'];
    }
    return $tm->parse(
    array(
    'subscribe_your_name'=>$lang['subscribe_your_name'],
    'subscribe_your_name_value'=>$lang['subscribe_your_name_value'],
    'subscribe_your_mail'=>$lang['subscribe_your_mail'],
    'subscribe_your_format'=>$lang['subscribe_your_format'],
    'subscribe_button'=>$lang['subscribe_button'],
    'all_refresh'=>$lang['all_refresh'],
    'control_word'=>$lang['control_word'],
    'control'=>$control,
    'cid'=>$cid
    ),
    $tm->parsein($tm->create('mod/subscribe/form.subscribe.block')));
?>